<?php /*a:3:{s:59:"/www/wwwroot/douyin/application/admin/view/staff/index.html";i:1713190176;s:60:"/www/wwwroot/douyin/application/admin/view/index_layout.html";i:1710484120;s:53:"/www/wwwroot/douyin/application/admin/view/layui.html";i:1712799662;}*/ ?>
<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title><?php echo config('site.web_name'); ?></title>
    <meta name="author" content="YZNCMS">
    <link rel="stylesheet" href="/static/libs/layui/css/layui.css">
    <link rel="stylesheet" href="/static/admin/css/admin.css?v=<?php echo htmlentities(app('config')->get('version.yzncms_release')); ?>">
    <link rel="stylesheet" href="/static/common/font/iconfont.css?v=<?php echo htmlentities(app('config')->get('version.yzncms_release')); ?>">
    <script src="/static/libs/layui/layui.js"></script>
    <script src="/static/libs/jquery/jquery.min.js"></script>
    <script type="text/javascript">
    //全局变量
    var GV = {
        'site':<?php echo json_encode($site); ?>,
        'image_upload_url': '<?php echo !empty($image_upload_url) ? htmlentities($image_upload_url) :  url("admin/ajax/upload", ["dir" => "images"]); ?>',
        'file_upload_url': '<?php echo !empty($file_upload_url) ? htmlentities($file_upload_url) :  url("admin/ajax/upload", ["dir" => "files"]); ?>',
        'attachment_select_url': '<?php echo !empty($attachment_select_url) ? htmlentities($attachment_select_url) :  url("general.attachments/select"); ?>',
    };
    </script>
</head>

<body class="childrenBody <?php echo defined('IS_DIALOG') && IS_DIALOG ? 'is-dialog' : ''; ?>">
    
<div class="layui-card">
    <div class="layui-card-header">账号管理</div>
    <div class="layui-card-body">
        <div class="layui-form">
            <table class="layui-hide" id="currentTable" lay-filter="currentTable"
                   data-auth-add="<?php echo $auth->check('staff/add'); ?>"
                   data-auth-edit="<?php echo $auth->check('staff/edit'); ?>"
                   data-auth-delete="<?php echo $auth->check('staff/del'); ?>"></table>
        </div>
        <input type="hidden" id="adminId" value="<?php echo htmlentities($adminId); ?>">
    </div>

    <script type="text/html" id="barTool">
        <a data-open='<?php echo url("edit"); ?>?id={{ d.id }}'
           class="layui-btn layui-btn-xs <?php echo $auth->check('staff/edit')?'':'layui-hide'; ?>" title="编辑"><i
                class='iconfont icon-brush_fill'></i></a>
        <a href='<?php echo url("del"); ?>?id={{ d.id }}'
           class="layui-btn layui-btn-danger layui-btn-xs layui-tr-del <?php echo $auth->check('staff/del')?'':'layui-hide'; ?>"><i
                class='iconfont icon-trash_fill'></i></a>
    </script>
</div>

    
    <script type="text/javascript">
layui.config({
	version: '<?php echo htmlentities(app('config')->get('version.yzncms_release')); ?>',
	base: '/static/libs/layui_exts/'
}).extend({
	yzn: 'yzn/yzn',
	yznForm: 'yznForm/yznForm',
	tab: "pear/tab",               // 多选项卡组件
	yznUpload: 'yznUpload/yznUpload',
	yznTable: 'yznTable/yznTable',
	clipboard: 'clipboard/clipboard.min',
	notice: 'notice/notice.min',
	iconPicker: 'iconPicker/iconPicker.min',
	ztree: 'ztree/ztree',
	dragsort: 'dragsort/dragsort.min',
	tagsinput: 'tagsinput/tagsinput',
	xmSelect: 'xmSelect/xm-select',
	selectPage: 'selectPage/selectpage.min',
	echarts: 'echarts/echarts',
	echartsTheme: 'echarts/echartsTheme',
	citypicker: 'citypicker/city-picker',
	dropzone: 'dropzone/dropzone.min',
	ueditor: 'ueditor/ueditor.min',
	cxselect: 'cxselect/cxselect',
	addons: 'addons',
    aliossUploader:'aliossUploader'
});
</script>
    
    
<script type="text/javascript">
    layui.use('yznTable', function () {
        var table = layui.yznTable;

        var init = {
            table_elem: '#currentTable',
            table_render_id: 'currentTable',
            add_url: '<?php echo url("add"); ?>',
            edit_url: '<?php echo url("edit"); ?>',
            delete_url: '<?php echo url("del"); ?>',
            modify_url: '<?php echo url("multi"); ?>',

        };

        var cloumns = [
            {field: 'id', width: 80, title: 'ID'},
            {field: 'username', title: '真实姓名', search: false},
            {field: 'phone', title: '手机号', searchOp: 'like'},

            {
                field: 'status',
                align: 'center',
                width: 120,
                title: '状态',
                unresize: true,
                templet: yznTable.formatter.switch,
                tips: "正常|冻结",
                selectList: {1: '正常', 0: '冻结'}
            },
            {field: 'create_time', title: '创建时间', search: false},
            {fixed: 'right', align: 'center', width: 140, title: '操作', toolbar: '#barTool'}
        ]

        var adminId = $('#adminId').val();
        if (adminId == 1) {
            cloumns.splice(2, 0, {field: 'admin.username', title: '团队', searchOp: 'like'});
        }

        table.render({
            init: init,
            toolbar: ['refresh', 'add'],
            url: '<?php echo url("index"); ?>',
            cols: yznTable.formatCols([
                cloumns
            ], init),
            page: {}
        });
        yznTable.listenSwitch({filter: 'status', url: init.modify_url});
        yznTable.listenSwitch({filter: 'identity', url: init.modify_url});

        yznTable.bindevent();
    });
</script>

</body>

</html>